<?php
/**
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
 * @license    GNU/GPL
 */
 
// No direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport('joomla.application.component.controller');
jimport( 'joomla.application.application' );
/**
 * Hello World Component Controller
 *
 * @package    Joomla.Tutorials
 * @subpackage Components
 */
class HizkuntzakController extends JController
{
    /**
     * Method to display the view
     *
     * @access    public
     */
    function display()
    {

        parent::display();
    }
    
    /**
     * Method to display the administration view
     *
     * @access    public
     */
   	function adminHizkuntzak(){
   		$document=&JFactory::getDocument();
			
		$viewName="hizkuntzak";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('admin');
		
        $view->adminHizkuntzak();
   	}
    
	function mainMenu()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="hizkuntzak";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('mainmenu');
		
        $view->mainMenu();
    }
    
	/**
     * Method to display the Hizkuntza Details view
     *
     * @access    public
     */
    function showLangDetails()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="hizkuntzak";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('firstwords');
		
        $view->firstWords();
    }
    
	function createWordsLang()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="create";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('wordslang');
		
        $view->createWordsLang();
    }
    
	function createQasLang()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="create";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('qaslang');
		
        $view->createQasLang();
    }
    
	/**
     * Method to display the create lang view
     *
     * @access    public
     */
    function createLang()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="create";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('language');
		
        $view->createLang();
    }
    
    /**
     * Method to display the create word view
     *
     * @access    public
     */
	function createWord()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="create";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('word');
		
        $view->createWord();
    }
    
	/**
     * Method to display the create qa view
     *
     * @access    public
     */
	function createQa()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="create";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('qa');
		
        $view->createQA();
    }
    
	/**
     * Method to display the create word view
     *
     * @access    public
     */
	function addWord()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="msgs";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('default');
		
        $view->addWord();
    }
    
	/**
     * Method to display the create word view
     *
     * @access    public
     */
	function addQa()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="msgs";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('default');
		
        $view->addQa();
    }
    
	function addLang()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="msgs";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('default');
		
        $view->addLang();
    }
    
    function addWordsLang(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="msgs";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('default');
		
        $view->addWordsLang();
    }
    
	function addQasLang(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="msgs";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('default');
		
        $view->addQasLang();
    }
    
	function addNumbersLang(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="msgs";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('default');
		
        $view->addNumbersLang();
    }
    
	function addSongLang(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="msgs";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('default');
		
        $view->addSongLang();
    }
    
	function whoSpeaks(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="hizkuntzak";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('whospeaks');
		
        $view->whospeaks();
    }
    
	function numbers(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="hizkuntzak";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('numbers');
		
        $view->numbers();
    }
    
	function qas(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="hizkuntzak";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('qas');
		
        $view->qas();
    }
    
	function songs(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="hizkuntzak";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('songs');
		
        $view->songs();
    }
    
	function createSongLang()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="create";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('editsongs');
		
        $view->createSongLang();
    }
    
	function createNumbersLang()
    {
    	$document=&JFactory::getDocument();
			
		$viewName="create";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('editnumbers');
		
        $view->createNumbersLang();
    }
    
	function noAccess(){
    	
    	$document=&JFactory::getDocument();
			
		$viewName="msgs";
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		
    	$formModel = &$this->getModel('hizkuntzak');
		
    	if (!JError::isError( $formModel )) {
			$view->setModel($formModel, true );
		}
		
		$view->setLayout('default');
		
        $view->noAccess();
    }
 
}
